﻿using System;
using Ornament.MemberShip;

namespace Ornament.Messages
{
    public class InfoReadState
    {
        protected InfoReadState()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="info"></param>
        public InfoReadState(User reader, Info info)
        {
            if (reader == null)
                throw new ArgumentNullException("reader");
            if (info == null)
                throw new ArgumentNullException("info");

// ReSharper disable DoNotCallOverridableMethodsInConstructor
            Reader = reader;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
// ReSharper disable DoNotCallOverridableMethodsInConstructor
            Info = info;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
        }

        public virtual User Reader { get; set; }
        public virtual Info Info { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public virtual ReadStatus Status { get; set; }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return (Info.Id + Reader.LoginId + Reader.Id).GetHashCode();
        }
    }
}